<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_SOURCE_VERSION}"/>

	<link rel="stylesheet" href="__PUBLIC__/filemanage/app.css?v={#$Think.config.ADMIN_SOURCE_VERSION}">
	<link rel="stylesheet" href="//at.alicdn.com/t/font_783249_m68ye1gfnza.css">
	<script src="//at.alicdn.com/t/font_783249_e5yrsf08rap.js"></script>
	<style>
		.control-group .controls label {
			display: inline-block;
		}

		ul, li {
			list-style: none;
		}

		.upload_img_list {
			width: 100%;
			display: block;
		}

		.upload_img_list li {
			float: left;
			margin-right: 5px;
			margin-bottom: 10px;
		}

		.upload_img_list li img {
			width: 80px;
			height: 80px;
			border: 1px solid #cccccc;
			padding: 1px;
		}

		.tab_on_select {
			background: #5bb75b;
		}

		.tab_on_select a {
			color: #ffffff;
		}

		.upload_img_list_350_476 {
			width: 100%;
			display: block;
		}

		.upload_img_list_350_476 li {
			float: left;
			margin-right: 5px;
			margin-bottom: 10px;
		}

		.upload_img_list_350_476 li img {
			width: 350px;
			height: 476px;
			border: 1px solid #cccccc;
			padding: 1px;
		}

		.nr_con:nth-child(n+1) {
			margin-top: 10px;
		}

		.table-1120 .table_input {
			border: 1px solid #ccc;
			border-radius: 2px;
			margin-right: 10px;
			float: left;
		}

		.table-1120 .table_input_no {
			border: 0px;
		}

		.table-1120 span {
			padding: 0 10px;
			width: 30px;
		}

		input.charge_input {
			border: none;
			border-left: 1px solid #ccc;
			border-right: 1px solid #ccc;
			display: inline-block;
		}

		.table-1120 input:hover {
			border-color: #ccc;
		}
	</style>
	<script>
	var BASE_URL = '{#$base_url}';
	var STORE_URL = "{#$admin_url}";
	</script>
</head>
<body>
<div id="content">
	<include file="Public/maintop"/>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="cyz-m-tab">
						<ul class="cyz-m-tab-title">
							<li class="cyz-m-this" data-toggle="nav_tab" href="#tab1">基本配置</li>
							<li data-toggle="nav_tab" href="#tab2">分享配置</li>
							<li data-toggle="nav_tab" href="#tab3">公众号配置</li>
							<li data-toggle="nav_tab" href="#tab4">支付配置</li>
						</ul>
					</div>
					<div class="widget-content">
						<form action="__ACTION__" method="post" class="form-horizontal" id="form_basic_validate">
							<div id="tab1" class="tab-pane active">
								<div class="widget-content nopadding">
									<div class="control-group">
										<label class="control-label"><span class="c-red">*</span>网站名称 :</label>
										<div class="controls">
											<input type="text" class="span3" style="width:500px;" name="app_title" value="{#$info.app_title}"/>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label"><span class="c-red">*</span>网站域名 :</label>
										<div class="controls">
											<input type="text" class="span3" style="width:500px;" name="app_domain" value="{#$info.app_domain}"/>
											<div class="Validform_checktip">如：http://www.baidu.com ,结尾不要加"/"</div>
										</div>
									</div>
									<!--									<div class="control-group">-->
									<!--										<label class="control-label"><span class="c-red">*</span>网站安全域名 :</label>-->
									<!--										<div class="controls">-->
									<!--											<input type="text" class="span3" style="width:500px;" name="app_https_domain" value="{#$info.app_https_domain}"/>-->
									<!--											<div class="Validform_checktip">如：https://www.baidu.com ,结尾不要加"/"</div>-->
									<!--										</div>-->
									<!--									</div>-->
									<div class="control-group">
										<label class="control-label"><span class="c-red">*</span>备用域名 :</label>
										<div class="controls">
											<input type="text" class="span3" style="width:500px;" name="beiyong_app_domain" value="{#$info.beiyong_app_domain}"/>
											<div class="Validform_checktip">重定向域名</div>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">联系客服 :</label>
										<div class="controls">
											<div class="upload_img_list" id="lit_pic_two_data">
												<notempty name="info.weixin_kefu">
													<li><img src="{#$info.weixin_kefu}"/></li>
												</notempty>
											</div>
											<input type="hidden" class="span5" name="weixin_kefu" id="lit_pic_two_data_value"
													value="{#$info.weixin_kefu}"/>
											<div style="width:100%;display: inline-block;">
												<a href="javascript:void(0);" onclick="upOneImage('two_data')"
														class="btn btn-success" style="padding:5px 12px;">上传图片</a>
											</div>
											<div class="Validform_checktip">建议图片尺寸：500*400</div>
										</div>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">隐私协议内容 :</label>
									<div class="controls">
                                        <textarea name="tcp_info" id="container" class="span5"
												style="width:700px;height:300px;">{#$info.tcp_info}</textarea>
									</div>
								</div>
							</div>
							<div id="tab2" class="tab-pane" style="display: none;">
								<div class="control-group">
									<label class="control-label">分享标题 :</label>
									<div class="controls">
										<input type="text" class="span5" style="width:500px;" name="app_share_title"
												value="{#$info.app_share_title}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">分享描述 :</label>
									<div class="controls">
										<textarea name="app_share_info" style="width: 500px;height: 60px;">{#$info.app_share_info}</textarea>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">分享图片 :</label>
									<div class="controls">
										<div class="upload_img_list" id="lit_pic_one_data">
											<notempty name="info.app_logo">
												<li><img src="{#$info.app_logo}"/></li>
											</notempty>
										</div>
										<input type="hidden" class="span5" name="app_logo" id="lit_pic_one_data_value"
												value="{#$info.app_logo}"/>
										<div style="width:100%;display: inline-block;">
											<a href="javascript:void(0);" onclick="upOneImage('one_data')"
													class="btn btn-success" style="padding:5px 12px;">上传图片</a>
										</div>
										<div class="Validform_checktip">建议图片尺寸：500*400</div>
									</div>
								</div>
							</div>
							<div id="tab4" class="tab-pane" style="display: none;">
								<div class="control-group">
									<label class="control-label" style="font-size: 16px;font-weight: bold;">微信支付配置</label>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>支付商户号 :</label>
									<div class="controls">
										<input type="text" class="span3" name="wepay_shanghuhao" value="{#$info.wepay_shanghuhao}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>支付密钥 :</label>
									<div class="controls">
										<input type="text" class="span3" name="wepay_partnerkey" value="{#$info.wepay_partnerkey}" errormsg="请输入您的微信支付密钥)" sucmsg="验证通过！"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>上传证书(apiclient_cert.pem) :</label>
									<div class="controls">
										<input type="text" class="span3" name="wepay_cert_pem" id="wepay_cert_pem" value="{#$info.wepay_cert_pem}"/><a href="javascript:void(0);" id="wepay_cert_pem_upload" class="btn btn-success" style="padding:5px 12px;">选择证书</a>
										<div class="Validform_checktip"></div>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>上传证书(apiclient_key.pem) :</label>
									<div class="controls">
										<input type="text" class="span3" name="wepay_key_pem" id="wepay_key_pem" value="{#$info.wepay_key_pem}"/><a href="javascript:void(0);" id="wepay_key_pem_upload" class="btn btn-success" style="padding:5px 12px;">选择证书</a>
										<div class="Validform_checktip"></div>
									</div>
								</div>
							</div>
							<div id="tab3" class="tab-pane" style="display: none;">
								<div class="control-group">
									<label class="control-label" style="font-size: 16px;font-weight: bold;">微信公众号配置</label>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>公众号名称 :</label>
									<div class="controls">
										<input type="text" class="span3" name="wechat_name" value="{#$info.wechat_name}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>公众号原始ID :</label>
									<div class="controls">
										<input type="text" class="span3" name="wechat_gid" value="{#$info.wechat_gid}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">公众号二维码 :</label>
									<div class="controls">
										<div class="upload_img_list" id="lit_pic_three_data">
											<notempty name="info.wechat_rcode">
												<li><img src="{#$info.wechat_rcode}"/></li>
											</notempty>
										</div>
										<input type="hidden" class="span5" name="wechat_rcode" id="lit_pic_three_data_value"
												value="{#$info.wechat_rcode}"/>
										<div style="width:100%;display: inline-block;">
											<a href="javascript:void(0);" onclick="upOneImage('three_data')"
													class="btn btn-success" style="padding:5px 12px;">上传图片</a>
										</div>
										<div class="Validform_checktip">建议图片尺寸：500*400</div>
									</div>
								</div>
								<!--								<div class="control-group">-->
								<!--									<label class="control-label">公众号二维码:</label>-->
								<!--									<div class="controls">-->
								<!--										<div class="am-form-file">-->
								<!--											<button type="button" data-input-name="wechat_rcode" data-file-type="image" data-is-multiple="0"-->
								<!--													class="upload-file btn btn-success">-->
								<!--												<i class="icon-upload-alt"></i> 选择图片-->
								<!--											</button>-->
								<!--											<div class="uploader-list am-cf">-->
								<!--												<neq name="info.wechat_rcode" value="">-->
								<!--													<div class="file-item">-->
								<!--														<a href="{#$info.wechat_rcode}" title="点击查看大图"-->
								<!--																target="_blank">-->
								<!--															<img src="{#$info.wechat_rcode}">-->
								<!--														</a>-->
								<!--														<input type="hidden" name="wechat_rcode"-->
								<!--																value="{#$info.wechat_rcode}">-->
								<!--														<i class="iconfont icon-shanchu file-item-delete"></i>-->
								<!--													</div>-->
								<!--												</neq>-->
								<!--											</div>-->
								<!--										</div>-->
								<!--									</div>-->
								<!--								</div>-->
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>APPID(公众号) :</label>
									<div class="controls">
										<input type="text" class="span3" name="wechat_appid" value="{#$info.wechat_appid}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>AppSecret :</label>
									<div class="controls">
										<input type="text" class="span3" name="wechat_appsecret" value="{#$info.wechat_appsecret}"/>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label"><span class="c-red">*</span>微信号类型 :</label>
									<div class="controls">
										<select name="wechat_type">
											<option value="1"
											<if condition="$info.wechat_type == 1">selected</if>
											>订阅号</option>
											<option value="2"
											<if condition="$info.wechat_type == 2">selected</if>
											>服务号</option>
											<option value="3"
											<if condition="$info.wechat_type == 3">selected</if>
											>认证订阅号</option>
											<option value="4"
											<if condition="$info.wechat_type == 4">selected</if>
											>认证服务号</option>
										</select>
									</div>
								</div>
							</div>
							<textarea id="upload_editor" style="width: 0;height: 0;display: none;"></textarea>
							<div class="form-actions">
								<button type="submit" class="btn btn-success">保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<hr>
	</div>
</div>
<!-- 文件库弹窗 -->
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.ui.custom.js"></script>
<script src="__JS__/jquery.uniform.js"></script>
<script src="__JS__/select2.min.js"></script>
<script src="__JS__/matrix.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/Validform.min.js"></script>
<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('container', {
	maximumWords: 999999,
	serverUrl: "{#:U('NewUpload/upload')}",
	zIndex: 100
});
var ue_uploader = UE.getEditor('upload_editor', {autoHeightEnabled: false, serverUrl: "{#:U('NewUpload/upload')}"});

function upOneImage(fname) {
	ue_uploader.ready(function() {
		var pickey = 1;
		ue_uploader.addListener('beforeInsertImage', function(t, arg) {
			if (pickey == 1) {
				$("#lit_pic_" + fname).html('<li><img src="' + arg[0].src + '" /></li>');
				$("#lit_pic_" + fname + "_value").val(arg[0].src);
			}
			pickey++;
		});
	});
	var myImage = ue_uploader.getDialog("insertimage");
	myImage.render();
	myImage.open();
}

$(function() {
	$('[data-toggle="nav_tab"]').on('click', function() {
		var self = $(this);
		self.parent().children("li").removeClass("cyz-m-this");
		$(".tab-pane").hide();
		self.addClass("cyz-m-this");
		$(self.attr("href")).show();
	});
})

</script>
<script type="text/javascript">
$(function() {
	$('input[type=checkbox],input[type=radio],input[type=file]').uniform();

	var loadi = null;
	var demo1 = $("#form_basic_validate").Validform({
		tiptype: 3,
		ajaxPost: true,
		postonce: true,
		tiptype: function(msg, o, cssctl) {
			if (!o.obj.is("form")) {
				var objtip = o.obj.siblings(".Validform_checktip");
				cssctl(objtip, o.type);
				objtip.text(msg);
			}
		},
		beforeSubmit: function(curform) {
			loadi = layer.load('表单正在处理中，请稍等 ...');
		},
		callback: function(data) {
			layer.close(loadi);
			if (data.status == 1) {
				layer.alert(data.msg, {icon: 1}, function() {
					window.location.reload();
				});
			} else {
				layer.alert(data.msg, {icon: 0});
			}
		}
	});
})
</script>
<script charset="utf-8" data-map="腾讯地图" src="//map.qq.com/api/js?v=2.exp&key=7AYBZ-EQCL4-4PFUT-X4GGH-7KO26-KMBQ6"></script>
<script type="text/javascript">
// 腾讯地图调用
$(function() {
	var geocoder, citylocation, map, marker = null;
	var markersArray = [];
	var x = {#$info.hexiao_lng};
	var y = {#$info.hexiao_lat};
	var center = new qq.maps.LatLng(y, x);
	map = new qq.maps.Map(document.getElementById('map'), {
		center: center,
		zoom: 13
	});
	marker = new qq.maps.Marker({
		position: new qq.maps.LatLng(y, x),
		map: map
	});

	//获取城市列表接口设置中心点
	if (y == '' || x == '') {
		citylocation = new qq.maps.CityService({
			complete: function(result) {
				map.setCenter(result.detail.latLng);
			}
		});
		//调用searchLocalCity();方法  根据用户IP查询城市信息。
		citylocation.searchLocalCity();
	}
	//绑定单击事件添加参数
	qq.maps.event.addListener(map, 'click', function(event) {
		marker.setMap(null);
		$("#hexiao_lng").prop("value", "");
		$("#hexiao_lng").prop("value", event.latLng.getLng());
		$("#hexiao_lat").prop("value", "");
		$("#hexiao_lat").prop("value", event.latLng.getLat());
		marker = new qq.maps.Marker({
			position: new qq.maps.LatLng(event.latLng.getLat(), event.latLng.getLng()),
			map: map
		});
	});
	geocoder = new qq.maps.Geocoder({
		complete: function(result) {
			marker.setMap(null);
			map.setCenter(result.detail.location);
			marker = new qq.maps.Marker({
				map: map,
				position: result.detail.location
			});
			$("#hexiao_lat").prop("value", marker.position.lat);
			$("#hexiao_lng").prop("value", marker.position.lng);
		}
	});
	$("#mapseacrh").click(function() {
		var address = $("#hexiao_address").val();
		geocoder.getLocation(address);
	});
});
</script>
</body>
</html>
